home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
serien
/
purity
/
nr.46
/
stinglibpcq
/
source
/
cpos.p
< prev
next >
Wrap
Text File
|
1995-03-27
|
559b
|
36 lines
External;
{$I "include:utils/stringlib.i"}
{$I "include:exec/memory.i"}
type
Str_List = record
pos : integer;
next : ^Str_List;
end;
Str_ListPtr = ^Str_List;
function Str_C_Pos(s : string;c : char) : Str_listPtr;
var
debut,cour,nouv : Str_ListPtr;
i : integer;
begin
debut := nil;
for i := 0 to (strlen(s)-1) do
if s[i] = c then
begin
nouv := allocmem(8,MEMF_PUBLIC);
nouv^.pos := i+1;
nouv^.next := nil;
if debut = nil then
debut := nouv
else
cour^.next := nouv;
cour := nouv;
end;
Str_C_Pos := debut;
end;